import { S } from '../../s';
import { IPSAppDataEntity } from '../../app/dataentity/ipsapp-data-entity';
import { IPSAppView } from '../../app/view/ipsapp-view';
import { IPSControlXDataContainer } from '../ipscontrol-xdata-container';
import { IPSNavigateContext } from '../ipsnavigate-context';
import { IPSNavigateParam } from '../ipsnavigate-param';
import { PSControlItemImpl } from '../pscontrol-item-impl';
import { IPSDEContextMenu } from '../toolbar/ipsdecontext-menu';
import { IPSDETreeNode } from './ipsdetree-node';
import { IPSDETreeNodeDataItem } from './ipsdetree-node-data-item';
import { IPSDETreeNodeRV } from './ipsdetree-node-rv';
import { IPSDERBase } from '../../dataentity/der/ipsderbase';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysCss } from '../../res/ipssys-css';
import { IPSSysImage } from '../../res/ipssys-image';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';

export class PSDETreeNodeImplBase
  extends PSControlItemImpl
  implements IPSDETreeNode, IPSControlXDataContainer
{
  get counterId(): string {
    return this.M.counterId;
  }

  get counterMode(): 0 | 1 {
    return this.M.counterMode;
  }

  get modelObj(): string {
    return this.M.modelObj;
  }

  protected namepslanguageres: IPSLanguageRes;
  getNamePSLanguageRes(): IPSLanguageRes | null {
    return (
      this.namepslanguageres ||
      (this.namepslanguageres = this.fillObjectModel(
        S._276,
        this.M.getNamePSLanguageRes,
        S._2bd,
      ) as IPSLanguageRes)
    );
  }

  get navFilter(): string {
    return this.M.navFilter;
  }

  protected navpsappview: IPSAppView;
  getNavPSAppView(): IPSAppView | null {
    return (
      this.navpsappview ||
      (this.navpsappview = this.fillObjectModel(
        S._1e,
        this.M.getNavPSAppView,
        S._308,
      ) as IPSAppView)
    );
  }

  protected navpsder: IPSDERBase;
  getNavPSDER(): IPSDERBase | null {
    return (
      this.navpsder ||
      (this.navpsder = this.fillObjectModel(
        S._272,
        this.M.getNavPSDER,
        S._309,
      ) as IPSDERBase)
    );
  }

  get navViewParamJO(): IModel {
    return this.M.navViewParamJO;
  }

  get nodeType(): string {
    return this.M.nodeType;
  }

  protected psappdataentity: IPSAppDataEntity;
  getPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.psappdataentity ||
      (this.psappdataentity = this.fillObjectModel(
        S._f,
        this.M.getPSAppDataEntity,
        S._2aa,
      ) as IPSAppDataEntity)
    );
  }

  protected psdecontextmenu: IPSDEContextMenu;
  getPSDEContextMenu(): IPSDEContextMenu | null {
    return (
      this.psdecontextmenu ||
      (this.psdecontextmenu = this.fillObjectModel(
        S._263,
        this.M.getPSDEContextMenu,
        S._30c,
      ) as IPSDEContextMenu)
    );
  }

  protected psdetreenodedataitems: IPSDETreeNodeDataItem[];
  getPSDETreeNodeDataItems(): IPSDETreeNodeDataItem[] | null {
    return (
      this.psdetreenodedataitems ||
      (this.psdetreenodedataitems = this.fillChildListModel(
        this.M.getPSDETreeNodeDataItems,
        S._293,
      ) as IPSDETreeNodeDataItem[])
    );
  }

  findPSDETreeNodeDataItem(objKey: any): IPSDETreeNodeDataItem | null {
    return this.getPSModel5(
      S._293,
      this.getPSDETreeNodeDataItems(),
      objKey,
    ) as IPSDETreeNodeDataItem;
  }

  protected psdetreenodervs: IPSDETreeNodeRV[];
  getPSDETreeNodeRVs(): IPSDETreeNodeRV[] | null {
    return (
      this.psdetreenodervs ||
      (this.psdetreenodervs = this.fillChildListModel(
        this.M.getPSDETreeNodeRVs,
        S._39a,
      ) as IPSDETreeNodeRV[])
    );
  }

  findPSDETreeNodeRV(objKey: any): IPSDETreeNodeRV | null {
    return this.getPSModel5(
      S._39a,
      this.getPSDETreeNodeRVs(),
      objKey,
    ) as IPSDETreeNodeRV;
  }

  protected psnavigatecontexts: IPSNavigateContext[];
  getPSNavigateContexts(): IPSNavigateContext[] | null {
    return (
      this.psnavigatecontexts ||
      (this.psnavigatecontexts = this.fillChildListModel(
        this.M.getPSNavigateContexts,
        S._8c,
      ) as IPSNavigateContext[])
    );
  }

  findPSNavigateContext(objKey: any): IPSNavigateContext | null {
    return this.getPSModel5(
      S._8c,
      this.getPSNavigateContexts(),
      objKey,
    ) as IPSNavigateContext;
  }

  protected psnavigateparams: IPSNavigateParam[];
  getPSNavigateParams(): IPSNavigateParam[] | null {
    return (
      this.psnavigateparams ||
      (this.psnavigateparams = this.fillChildListModel(
        this.M.getPSNavigateParams,
        S._8a,
      ) as IPSNavigateParam[])
    );
  }

  findPSNavigateParam(objKey: any): IPSNavigateParam | null {
    return this.getPSModel5(
      S._8a,
      this.getPSNavigateParams(),
      objKey,
    ) as IPSNavigateParam;
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get treeNodeType(): 'STATIC' | 'DE' | 'CODELIST' {
    return this.M.treeNodeType;
  }

  hasPSDETreeNodeRSs(): boolean {
    return this.M.hasPSDETreeNodeRSs;
  }

  get allowDrag(): boolean {
    return this.M.allowDrag != null ? this.M.allowDrag : false;
  }

  get allowDrop(): boolean {
    return this.M.allowDrop != null ? this.M.allowDrop : false;
  }

  get allowEditText(): boolean {
    return this.M.allowEditText != null ? this.M.allowEditText : false;
  }

  get allowOrder(): boolean {
    return this.M.allowOrder != null ? this.M.allowOrder : false;
  }

  get appendPNodeId(): boolean {
    return this.M.appendPNodeId;
  }

  get disableSelect(): boolean {
    return this.M.disableSelect;
  }

  get enableCheck(): boolean {
    return this.M.enableCheck;
  }

  get enableEditData(): boolean {
    return this.M.enableEditData;
  }

  get enableExport(): boolean {
    return this.M.enableExport != null ? this.M.enableExport : false;
  }

  get enableFilter(): boolean {
    return this.M.enableFilter;
  }

  get enableImport(): boolean {
    return this.M.enableImport != null ? this.M.enableImport : false;
  }

  get enableNewData(): boolean {
    return this.M.enableNewData;
  }

  get enableQuickCreate(): boolean {
    return this.M.enableQuickCreate;
  }

  get enableQuickSearch(): boolean {
    return this.M.enableQuickSearch;
  }

  get enableRemoveData(): boolean {
    return this.M.enableRemoveData;
  }

  get enableSearch(): boolean {
    return this.M.enableSearch != null ? this.M.enableSearch : false;
  }

  get enableViewData(): boolean {
    return this.M.enableViewData;
  }

  get expandFirstOnly(): boolean {
    return this.M.expandFirstOnly;
  }

  get expanded(): boolean {
    return this.M.expanded;
  }

  get loadDefault(): boolean {
    return this.M.loadDefault != null ? this.M.loadDefault : true;
  }

  get pickupMode(): boolean {
    return this.M.pickupMode != null ? this.M.pickupMode : false;
  }

  get readOnly(): boolean {
    return this.M.readOnly != null ? this.M.readOnly : false;
  }

  get rootNode(): boolean {
    return this.M.rootNode;
  }

  get selectFirstOnly(): boolean {
    return this.M.selectFirstOnly;
  }

  get selected(): boolean {
    return this.M.selected;
  }
  get cls(): string {
    return 'PSDETreeNodeImplBase';
  }
  instanceof(cls: string): boolean {
    if (
      cls == S._4b ||
      cls == S._114 ||
      cls == S._45 ||
      cls == S._115 ||
      cls == S._7 ||
      cls == S._1b2
    )
      return true;
    return super.instanceof(cls);
  }
}
